<?php


namespace App\Transformers\Wechat;


use League\Fractal\TransformerAbstract;

class WechatNewCategoryTransFormer extends TransformerAbstract
{
    public function transform($data)
    {
        return [
            'id' => $data->id,
            'cate_name' =>$data->cate_name ?? '',
            'sort' =>$data->sort ?? '',
            'news_id' =>$data->news_id ?? '',
            'cate_image' =>$data->cate_image ?? '',
            'status' =>$data->status ?? '',
            'created_at' => $data->created_at ? $data->created_at->format("Y-m-d H:i:s") : '',
            'updated_at' => $data->updated_at ? $data->updated_at->format("Y-m-d H:i:s") : '',
        ];

    }

}
